//list容器  通过  list::sort()进行排序，排序的顺序
//需要在容器重载的元素中  重载 operator <
#include <iostream>
#include <vector>
#include <algorithm>
#include <list>
#include <string>

using std::list;
using std::cout;
using std::endl;
using std::vector;
using std::string;
class Node
{
public:
	Node(int value) :value(value) {}
	bool operator<(const Node& node) const
	{
		return this->value > node.value;
	}
	string transToString()
	{
		return std::to_string(value);
	}
	int value;
private:
	Node *left;
	Node *right;
};

void printVec(const vector<int> &vec)
{
	for (auto item : vec)
	{
		cout << item << "\t";
	}
	cout << endl;
}

int main()
{
	vector<int> v1({ 4, 7, 2, 6, 8 });
	list<Node> listNode;
	for (auto item : v1) {
		listNode.push_back(Node(item));
	}
	listNode.sort();
	for (auto item : listNode) {
		cout << item.transToString();
	}
}